xen/memory: Don't skip the RCU unlock path in acquire_resource()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 22 Sep 2020 14:09:59 +0000 (16:09 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 22 Sep 2020 14:09:59 +0000 (16:09 +0200)
commit5eab5f0543e4f5fc52f7e2d823a29a6b1567fc16
tree1abfe5e191ef044e82a84128ea2a41b25c7d58cf
parentb04d6731eedd639e078e0f0d8147c6b156875ac3
xen/memory: Don't skip the RCU unlock path in acquire_resource()

In the case that an HVM Stubdomain makes an XENMEM_acquire_resource hypercall,
the FIXME path will bypass rcu_unlock_domain() on the way out of the function.

Move the check to the start of the function.  This does change the behaviour
of the get-size path for HVM Stubdomains, but that functionality is currently
broken and unused anyway, as well as being quite useless to entities which
can't actually map the resource anyway.

This is XSA-334.

Fixes: 83fa6552ce ("common: add a new mappable resource type: XENMEM_resource_grant_table")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/memory.c